javac -cp : cannot find symbol problem [migrated]

Posted by LivingThing on Programmers See other posts from Programmers or by LivingThing
Published on 2012-04-11T13:20:00Z Indexed on 2012/04/11 17:41 UTC
Read the original article Hit count: 402

Filed under:
|

I have 3 classes CustomerAddress, Customer and CustomerMain.

Customer has a import statement :

import org.abc.customers.CustomerAddress;

While CustomerMain has an import statement :

import org.abc.customers.CustomerAddress; 
import org.abc.customers.Customer;

The package for all of these classes are

package org.abc.customer

Now, this program works fine on eclipse but when i try to compile and run on cmd prompt it would not compile

javac CustomerAddress.java 

compiles fine

then since Customer depends on CustomerAddress

i give

javac -cp . Customer.java

but the compiler complains error cannot find symbol CustomerAddress

Thanks

© Programmers or respective owner

Related posts about java

Related posts about command-line